package com.jobsys.job;

import org.apache.log4j.Logger;
import org.quartz.JobExecutionContext;

import com.jobsys.pageprocesser.QianChengWuYouPage;
import com.jobsys.utils.SpiderThreadPool;

import us.codecraft.webmagic.Spider;

/**
 * 前程无忧（51job）
 * 
 * @author
 *
 */
public class QianChengWuYouJob extends AbsJob {
	private Logger logger = Logger.getLogger(QianChengWuYouJob.class);

	@Override
	protected void process(JobExecutionContext context) {
		// TODO Auto-generated method stub
		logger.info("爬取前程无忧...");
		String url = "http://search.51job.com/list/000000,000000,0000,00,0,05%252C06%252C07%252C08%252C09,%2B,2,1.html?lang=c&stype=1&postchannel=0000&workyear=99&cotype=99&degreefrom=04%2C05%2C06&jobterm=01&companysize=99&lonlat=0%2C0&radius=-1&ord_field=1&confirmdate=9&fromType=&dibiaoid=0&address=&line=&specialarea=00&from=&welfare=%E5%91%A8%E6%9C%AB%E5%8F%8C%E4%BC%91";
		Spider spider = Spider.create(new QianChengWuYouPage()).addUrl(url);
		// 加入线程池管理
		SpiderThreadPool.add(this.getClass().getName(), spider);
		spider.run();
	}
}
